import { Request } from '../utils/request';


//登录接口
export const login = (data) => Request({
    url:`/api/user/login.do`,
    method:"POST",
    params:data
})

//主页请求  统计接口  函数调用传实参
export const  home = () => Request({
    url:`/api/statistic/base_count.do`,
    method:"get"
})



// axios({
//     url: ,
//     method: ,
//     params:  ,
//     data:  ,
//     headers:  ,
// })

// axios.get   axios.post


//商品管理  产品列表接口
export const  commodity = (data) => Request({
    url:`/api/product/list.do`,
    method:"get",
    params:data
})


//商品查看详情  productId
export const deatil=(data)=>Request({
    url:`/api/product/detail.do?productId=${data}`,
    method:"GET"
})


//品类管理
export const category=(data)=>Request({
    url:"/api/category/get_category.do",
    method:"GET",
    params:data
})



//品类添加
export const addcategory=(data)=>Request({
    url:"/api/category/add_category.do",
    method:"POST",
    params:data
})
//修改品类名称
export const setcategory=(data)=>Request({
    url:"/api/category/set_category_name.do",
    method:"POST",
    params:data
})
//查看子品类
export const categoryItem=(data)=>Request({
    url:"/api/category/get_deep_category.do",
    method:"POST",
    params:data
})

//订单管理
export const order=(data)=>Request({
    url:`/api/order/list.do`,
    method:"GET",
    params:data
})

//用户管理
export const  users = () => Request({
    url:`/api/user/list.do`,
    method:"post"
})

//用户分页
export const userssear=(data)=>Request({
    url:`/api/user/list.do`,
    method:"post",
    params:data
})


//商品管理搜索
export const commSearchname=(data)=>Request({
    url:`/api/product/search.do`,
    method:"get",
    params:data
})


//新增商品product/save.do  
export const addComm = (form)=>Request({
    url:`/api/product/save.do`,
    method:"POST",
    params:form
})


//商品编辑
export const updataComm = (form)=>Request({
    url:`/api/product/save.do`,
    method:"POST",
    params:form
})

//商品上架，下架
export const dataComm = (form)=>Request({
    url:`/api/product/set_sale_status.do`,
    method:"POST",
    params:form
})


//订单查询
export const orderId = (orderid)=>Request({
    url:`/api/order/search.do?orderNo=${orderid}`,
    method:"GET"
})

//上传图片
export const upimage = (data)=>Request({
    url:`/api/product/upload.do`,
    method:"POST"
})

//品类1
export const category1 = (data)=>Request({
    url:`/api/category/get_category.do`,
    method:"GET",
    params:data
})







